public class Text1 {
    public static boolean isPalindrome(int x) {
        if(x>=0){
            //力扣题9，思路：翻转一半数字if
           if (x % 10 == 0 && x != 0) {
                      return false;
                   }
            int num=0;
            while(x>num){
                num = num*10 + x%10;
                x=x/10;
            }

            if (x==num|x==num/10){
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        int x = 10;
        boolean ret;
        ret = isPalindrome(x);
        System.out.println(ret);
    }
}
